This is a description of EJB-8 feature and steps to verify the expected behavior.  We already went over some of it during last week's iteam.  I'd like to propose this as the formal QA/Doc Handoff document.  If anyone, especially QA and Doc, have questions, feel free to raise it in iteam.

description:
==========
Now that the EJB 3.1 specification defines portable EJB JNDI names, there is less need for the old vendor-specific JNDI. By default in V3, GlassFish-specific default JNDI names are applied automatically for backward compatibility, but that can lead to some ease-of-use issues. For example, deploying two different applications containing a Remote EJB component that exposes the same remote interface will cause a conflict between the default JNDI names.

By default, vendor-specific default JNDI names are applied automatically for backward compatibility.  GlassFish-specific JNDI names can be disabled in one of 2 ways:

(1), set the property disable-nonportable-jndi-names to true under <ejb-container> element in domain.xml.  This will take effect for all EJBs deployed to the server, unless overridden by means of (2).  For example,

asadmin set server.ejb-container.property.disable-nonportable-jndi-names="true"
server.ejb-container.property.disable-nonportable-jndi-names=true

Command set executed successfully.

(2), set the property disable-nonportable-jndi-names to true under <glassfish-ejb-jar> element in glassfish-ejb-jar.xml.  For example, the following is a complete glassfish-ejb-jar.xml with this property set to true.  This will take effect for all EJBs packaged inside the current ejb-jar file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 EJB 3.1//EN" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
<glassfish-ejb-jar>
    <disable-nonportable-jndi-names>true</disable-nonportable-jndi-names>
</glassfish-ejb-jar>

Both properties default to false.  Acceptable values are "true" or "false".  The property in glassfish-ejb-jar.xml, if explicitly set, overrides the one in domain.xml.

devtest:
======
cd trunk/v2/appserv-tests
svn update
cd trunk/v2/appserv-tests/devtests/ejb/ejb31/full/disable_nonportable_jndi
ant all

This devtest verifies the expected behavior by looking up a GlassFish-specific jndi name of a stateless bean that should not exist since it has been disabled.  The test passes if the lookup failed with javax.naming.NamingException.

manual test:
==========
To visually verify it, one can first set the property in either one of the two ways, deploy a ejb module, or an EAR containing ejb, then run:

$ asadmin list-jndi-entries
UserTransaction: com.sun.enterprise.transaction.TransactionNamingProxy$UserTransactionProxy
java:global: com.sun.enterprise.naming.impl.TransientContext
jdbc: com.sun.enterprise.naming.impl.TransientContext
ejb: com.sun.enterprise.naming.impl.TransientContext
com.sun.enterprise.container.common.spi.util.InjectionManager: com.sun.enterprise.container.common.impl.util.InjectionManagerImpl

The output should not contain any GlassFish-specific jndi names for the deployed application.

resources:
=========
EJB 3.1 one pager / function spec:

http://wikis.sun.com/display/GlassFish/GlassFishv3.1EJBOnePager